package cn.tedu.fwmk.detail.service.Impl;

import cn.tedu.common.vo.JsonResult;
import cn.tedu.fwmk.detail.mapper.DetailMapper;
import cn.tedu.fwmk.detail.pojo.dto.DetailParam;
import cn.tedu.fwmk.detail.pojo.dto.DetailQuery;
import cn.tedu.fwmk.detail.pojo.vo.DetailVO;
import cn.tedu.fwmk.detail.service.DetailService;
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class DetailServiceImpl implements DetailService {
    @Autowired
    DetailMapper detailMapper;

    @Override
    public void insertDetail(DetailParam detailParam) {
        log.debug("添加服务详情块={}",detailParam);
        DetailQuery detailQuery=new DetailQuery();
        BeanUtils.copyProperties(detailParam,detailQuery);
            detailMapper.insertDetail(detailParam);
        }

    @Override
    public void deleteDetail(Long serviceId) {
        log.debug("删除服务详情块={}",serviceId);
        detailMapper.deleteById(serviceId);
    }


    @Override
    public List<DetailVO> selectSearchbar(DetailQuery detailQuery) {
            log.debug("查询搜索栏关键词={}",detailQuery);
            List<DetailVO> list=detailMapper.selectSearchbar();
            return list;
    }
}

